package com.backend.prototype.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import javax.annotation.Resource;

/**
 * 描述：
 *
 * @author xianggj
 * @Date 2021/8/25 16:06
 **/
@Configuration
public class WebMVCConfig implements WebMvcConfigurer {

    @Value("${source.dir}")
    private String sourceDir;
    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler("ui/**").addResourceLocations("file:"+sourceDir);
    }

}
